﻿using System;

namespace CommonUtils.Models.Attribute
{
    /// <summary>
    /// 枚举注释的自定义属性类
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Field 
        | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true)]
    public class DescriptionAttribute : System.Attribute
    {
        /// <summary>
        /// 描述特性构造
        /// </summary>
        /// <param name="description">描述</param>
        public DescriptionAttribute(string description) : this(description, false)
        {
            m_strDescription = description;
        }

        /// <summary>
        /// 描述特性构造
        /// </summary>
        /// <param name="description">描述</param>
        /// <param name="flag">标志位,区分状态</param>
        public DescriptionAttribute(string description, bool flag)
        {
            m_strDescription = description;
            m_flag = flag;
        }

        private string m_strDescription;
        public string Description
        {
            get { return m_strDescription; }
        }

        private bool m_flag;
        public bool Flag
        {
            get { return m_flag; }
        }
    }
}
